package demo2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: syyyy
 * Date: 2025-07-05
 * Time: 16:31
 */
public class A {
    public int date1=1;
    public int date2=2;
    private int date3=3;
    private static int date4=4;




    static class B{
        public int date5=5;
        public int date6=6;
        public int date7=7;



        public void test(){
            System.out.println("内部类方法被执行");
            System.out.println(date4);
            System.out.println(date5);
            System.out.println(date6);
            System.out.println(date7);
            //静态内部类无法直接访问外部非静态的成员变量和方法，要先创建一个对象
            A a=new A();
            System.out.println(a.date1);
            System.out.println(a.date2);
            System.out.println(a.date3);

        }

    }


}
